﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NewTaskPage1.aspx.cs" Inherits="SATF.NewTaskPage1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="../css/main.css" rel="stylesheet" type="text/css" />
</head>
<style type="text/css">
        .highlight
        {
        	font-weight: bold;
            background-color : lightgreen;
        }
        .nonestyle
        {
            background-color : white;
        }
        .mright
        {
            margin-right: 5px;
        }
        .datecontainer .x-form-field-trigger-wrap
        {
            margin-right: 5px;
        }
         .red
        {
             color: red;
        }

    </style>

<body>
    <form id="form1" runat="server">
        <ext:PageManager ID="PageManager1" runat="server" AutoSizePanelID="RegionPanel1"/>
        <ext:RegionPanel ID="RegionPanel1" ShowBorder="false" runat="server">
        <Regions>
            <ext:Region ID="mainRegion" ShowHeader="false" Layout="Fit" Margins="0 0 0 0" Position="Center" runat="server" Title="新建任务表单">
                <Items>
                    <ext:Panel ID="NewTaskPanel" BodyPadding="5px" runat="server" EnableBackgroundColor="true"
                        EnableCollapse="True" Title="新建任务表单" AutoScroll="True">
                        <Items>

                            <ext:GroupPanel runat="server" Title="案例文件或执行流配置" ID="CaseGroupPanel"  EnableCollapse="True" AutoScroll="True">
                                <Items>
                                    <ext:TabStrip ID="TabStrip1"  ShowBorder="true" ActiveTabIndex="0"
                                        runat="server" Height="300px" AutoScroll="True">
                                        <Tabs>
                                            <ext:Tab ID="Tab1" Title="选择案例脚本执行" EnableBackgroundColor="true" BodyPadding="5px"
                                                runat="server" AutoScroll="True" Layout="Fit">
                                                <Items>
                                                    <ext:Tree ID="CaseTree"   ShowHeader="true" 
                                                        Title="案例树" runat="server" EnableArrows="true" OnNodeCommand="CaseTree_NodeCommand">
                                                    </ext:Tree>
                                                </Items>
                                            </ext:Tab>
                                            <ext:Tab ID="Tab2" Title="配置执行流" BodyPadding="5px"
                                                EnableBackgroundColor="true" runat="server" AutoScroll="True" Layout="Fit">
                                                <Items>
                                                    <ext:ContentPanel ID="ContentPanel1" ShowBorder="false" BodyPadding="10px" ShowHeader="false" AutoScroll="true"
                                                        CssClass="intro" runat="server" >
                                                        <strong>此tab页，用于自定义执行流的配置，自行配置执行命令参数，可以调用某个工具等。（暂未实现）</strong>
                                                    </ext:ContentPanel>
                                                </Items>
                                            </ext:Tab>
                                        </Tabs>
                                    </ext:TabStrip>
                                </Items>
                            </ext:GroupPanel>

                            <ext:GroupPanel runat="server" Height="400px"  Title="测试机器配置" ID="MachineGroupPanel" EnableCollapse="True" Layout="Column">
                                <Items>
                                    <ext:Grid ID="MachineGrid" Title="机器列表" ShowBorder="true" ShowHeader="true" AutoHeight="true"
                                        PageSize="3" runat="server" EnableCheckBoxSelect="True" DataKeyNames="Id,Name"
                                        EnableRowNumber="True" ColumnWidth="70%" Height="380px" AllowSorting="True" OnSort="MachineGrid_Sort">
                                        <Toolbars>
                                            <ext:Toolbar ID="Toolbar2" runat="server">
                                                <Items>
                                                    <ext:Button ID="NewMachineButton" Text="新增新的机器" Icon="Add" EnablePostBack="false" runat="server">
                                                    </ext:Button>
                                                    <ext:Button ID="AllMachineButton" Text="查看所有机器" IconUrl="../icon/monitor.png"  runat="server"
                                                        OnClick="AllMachineButton_Click">
                                                    </ext:Button>
                                           
                        <%--                            <ext:TextBox id="SearchMachineTextBox" Width="200px"  EnableAjax="True" EnableAjaxLoading="True" Enabled="True" />
                                                    <ext:Button ID="SearchMachineButton" Text="筛选" IconUrl="../icon/search.png"  runat="server"
                                                        OnClick="SearchMachineButton_Click">
                                                    </ext:Button>--%>

                                                    <ext:TwinTriggerBox ID="SearchTriggerBox" OnTrigger1Click="SearchTriggerBox_Trigger1Click" OnTrigger2Click="SearchTriggerBox_Trigger2Click"
                                                        Trigger1Icon="Clear" ShowTrigger1="False" EmptyText="在此输入关键词检索" Trigger2Icon="Search"
                                                        runat="server" Width="200px">
                                                    </ext:TwinTriggerBox>

                                                </Items>
                                            </ext:Toolbar>
                                        </Toolbars>
                                        <Columns>
                                            <ext:BoundField Width="100px" DataField="IP" DataFormatString="{0}" HeaderText="IP" SortField="IP" />
                                            <ext:BoundField Width="100px" DataField="Name" DataFormatString="{0}" HeaderText="机器名" />
                                            <ext:BoundField Width="100px" DataField="GroupName" DataFormatString="{0}" HeaderText="所属组" SortField="GroupName" />
                                            <ext:BoundField Width="100px" DataField="UserName" DataFormatString="{0}" HeaderText="指派用户" />
                                            <ext:CheckBoxField Width="60px" RenderAsStaticField="true" DataField="Enabled" HeaderText="是否可用" SortField="Enabled" />
                                            <ext:BoundField Width="100px" DataField="State_Str" DataFormatString="{0}" HeaderText="机器状态" SortField="State_Str" />

                                            <ext:WindowField ColumnID="myWindowField" Width="60px" WindowID="Window1" HeaderText="窗口列"
                                                Icon="TableEdit" ToolTip="编辑" DataTextFormatString="{0}" DataIFrameUrlFields="Id"
                                                DataIFrameUrlFormatString="grid_iframe_window.aspx?id={0}" DataWindowTitleField="Name"
                                                DataWindowTitleFormatString="编辑 - {0}" />
                                            <ext:TemplateField HeaderText="模板列">
                                                <ItemTemplate>
                                                    <a href="http://www.sogou.com/">
                                                        编辑</a>
                                                </ItemTemplate>
                                            </ext:TemplateField>
                                        </Columns>
                                    </ext:Grid>

                                     <ext:Panel ID="MachinePanel2" Width="80px" EnableBackgroundColor="true" runat="server"
                                        BodyPadding="10px" ShowBorder="true" ShowHeader="true" Height="380px" Title=" 添加/删除" Layout="Row">
                                        <Items>
                                            <ext:Button id="SelectMachineButton" Text="添加" runat="server" IconUrl="../icon/add.png" 
                                                OnClick="SelectMachineButton_Click"></ext:Button>
                                            
                                            <ext:Button id="RemoveMachineButton" Text="移除" runat="server" IconUrl="../icon/delete.png"
                                                OnClick="RemoveMachineButton_Click"></ext:Button>
                                        </Items>
                                    </ext:Panel>

                                       <ext:Panel ID="MachinePanel3" ColumnWidth="30%" EnableBackgroundColor="true" runat="server"
                                            BodyPadding="5px" ShowBorder="true" ShowHeader="true" Layout="Fit" Height="380px" Title="已选机器列表">
                                            <Items>
                                                <ext:Grid ID="SelectedMachineGrid" Title="已选机器" ShowBorder="true" ShowHeader="true" AutoHeight="true"
                                                    PageSize="3" runat="server" EnableCheckBoxSelect="True" DataKeyNames="Id,Name"
                                                    EnableRowNumber="True"  Height="380px">
                                              
                                                    <Columns>
                                                        <ext:BoundField Width="100px" DataField="IP" DataFormatString="{0}" HeaderText="IP" />
                                                        <ext:BoundField Width="100px" DataField="GroupName" DataFormatString="{0}" HeaderText="所属组"/>
                                                        <ext:CheckBoxField Width="60px" RenderAsStaticField="true" DataField="Enabled" HeaderText="是否可用" />
                                                    </Columns>
                                                </ext:Grid>
                                            </Items>
                                        </ext:Panel>



                                </Items>
                             </ext:GroupPanel>

                             <ext:GroupPanel runat="server"  AutoHeight="true" Title=" 其他配置" ID="GroupPanel1" EnableCollapse="True" Layout="Form">
                                <Items>
                                    <ext:Panel ID="Panel1" runat="Server" ShowHeader="False" BodyPadding="10px"  EnableBackgroundColor="True" ShowBorder="False" Layout="Column"
                                        CssClass="x-form-item">
                                        <Items>
                                            <ext:Label ID="InstallPathLable" Width="100px" runat="server" ShowLabel="false"
                                                Text="安装包下载路径：">
                                            </ext:Label>
                                            <ext:TextBox runat="Server" ID="InstallPathTextBox" Width="400px" CssClass="mright" Height="25px"></ext:TextBox>
                                        </Items>
                                    </ext:Panel>
                                    <ext:Panel ID="Panel2" runat="Server" ShowHeader="False" BodyPadding="10px" EnableBackgroundColor="True" ShowBorder="False" Layout="Column">
                                        <Items>
                                            <ext:Label ID="MailToLable" Width="100px" runat="server" ShowLabel="false"
                                                Text="邮件收件人：">
                                            </ext:Label>
                                            <ext:TextBox runat="Server" ID="MailToTextBox" Width="400px" Height="25px"></ext:TextBox>
                                            <ext:Label ID="MailToLableInfo" Width="200px" runat="server" ShowLabel="false" 
                                                Text="多个收件人用分号（;）隔开"  CssClass="red">
                                            </ext:Label>
                                        </Items>
                                    </ext:Panel>

                                     <ext:Panel ID="Panel3" runat="Server" ShowHeader="False" BodyPadding="10px" EnableBackgroundColor="True" ShowBorder="False" Layout="Column">
                                        <Items>
                                            <ext:Label ID="MailCCLable" Width="100px" runat="server" ShowLabel="false"
                                                Text="邮件抄送人：">
                                            </ext:Label>
                                            <ext:TextBox runat="Server" ID="MailCCTextBox" Width="400px" Height="25px"></ext:TextBox>
                                            <ext:Label ID="MailCCLableInfo" Width="200px" runat="server" ShowLabel="false"
                                                Text="多个抄送人用分号（;）隔开"  CssClass="red">
                                            </ext:Label>
                                        </Items>
                                    </ext:Panel>

                                      <ext:Panel ID="Panel4" runat="Server" ShowHeader="False" BodyPadding="10px" EnableBackgroundColor="True" ShowBorder="False" Layout="Column">
                                        <Items>
                                            <ext:Label ID="AutoRunLabel" Width="150px" runat="server" ShowLabel="false"
                                                Text="是否配置自动运行时间：" >
                                            </ext:Label>        
                                            <ext:CheckBox ID="AutoRunCheckBox" AutoPostBack="true"  runat="server" OnCheckedChanged="AutoRunCheckBox_CheckedChanged"></ext:CheckBox>                               
                                        </Items>
                                    </ext:Panel>

                                    <ext:GroupPanel runat="server" Height="100px"  Title=" 自动运行配置" ID="AutoRunGroupPanel" EnableCollapse="True" 
                                        Layout="Form" Enabled="False" Collapsed="True">
                                        <Items>
                                            <ext:ContentPanel ID="ContentPanel2" ShowBorder="false" BodyPadding="10px" ShowHeader="false" AutoScroll="true"
                                                        CssClass="intro" runat="server" >
                                                <strong>用于配置案例自动执行时，启动时间，以及执行间隔等。（暂未实现）</strong>
                                            </ext:ContentPanel>
                                        </Items>
                                    </ext:GroupPanel>

                                     <ext:Panel ID="Panel5" runat="Server" ShowHeader="False" BodyPadding="10px" EnableBackgroundColor="True" ShowBorder="False" Layout="Column">
                                        <Items>
                                            <ext:Label ID="CaseSplitLable" Width="100px" runat="server" ShowLabel="True"
                                                Text="是否拆分用例：">
                                            </ext:Label>
                                            <ext:CheckBox ID="CaseSplitCheckBox"  runat="server" AutoPostBack="true" OnCheckedChanged="CaseSplitCheckBox_CheckedChanged"></ext:CheckBox>
                                            <ext:Label ID="Label2" Width="100px" runat="server" ShowLabel="false">
                                            </ext:Label>
                                            <ext:Button ID="CreateCaseCfgButton" Enabled="false"  runat="server" Text="创建机器对应案例的清单"></ext:Button>
                                        </Items>
                                    </ext:Panel>

                                    <ext:Grid ID="CaseSplitGrid" Title="用例拆分详情" ShowBorder="true" ShowHeader="true" AutoHeight="true"
                                        PageSize="3" runat="server"  DataKeyNames="Id,Name" AutoPostBack="true"
                                        EnableRowNumber="True" Height="200px" EnableCollapse="True" Hidden="true">
                                        <Columns>
                                            <ext:BoundField Width="100px" DataField="机器IP" DataFormatString="{0}" HeaderText="机器IP" />
                                            <ext:BoundField Width="150px" DataField="执行用例文件名" DataFormatString="{0}" HeaderText="执行用例文件名"/>
                                            <ext:TemplateField HeaderText="案例开始序号">
                                                <ItemTemplate>
                                                    <ext:TextBox ID="CaseStartTextBox" runat="server" width="80px" Text='<%# Eval("CaseStartID") %>'></ext:TextBox>
                                                </ItemTemplate>
                                            </ext:TemplateField>
                                             <ext:TemplateField HeaderText="案例结束序号">
                                                <ItemTemplate>
                                                    <ext:TextBox ID="CaseEndTextBox" runat="server" width="80px" Text='<%# Eval("CaseEndID") %>'></ext:TextBox>
                                                </ItemTemplate>
                                            </ext:TemplateField>
                                        </Columns>
                                    </ext:Grid>
                                  
                                </Items>
                             </ext:GroupPanel>
                        </Items>
                    </ext:Panel> 
                </Items>
            </ext:Region>


            <ext:Region ID="Region1" Margins="0 0 0 0" ShowBorder="false" ShowHeader="false"
                Position="Bottom" Layout="Fit" runat="server">
                <Toolbars>
                    <ext:Toolbar ID="Toolbar1" Position="Bottom" runat="server">
                        <Items>
                            <ext:ToolbarFill ID="ToolbarFill1" runat="server"></ext:ToolbarFill>
                            <ext:LinkButton ID="nextButton" Text="下一步"
                                runat="server">
                            </ext:LinkButton>
                            <ext:Label ID="Label1" Width="200px" runat="server" Label="Label" >
                            </ext:Label>
                        </Items>
                    </ext:Toolbar>
                </Toolbars>
            </ext:Region>
        </Regions>
    </ext:RegionPanel>

    </form>
</body>
</html>
